package com.project.mvprxsample.ui.fragment;

import android.os.Bundle;
import android.view.View;

import com.project.mvprxsample.R;

import org.json.JSONException;
import org.json.JSONObject;

import butterknife.ButterKnife;
import butterknife.OnClick;

public class SecondFragment extends BaseFragment {
    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;

    public SecondFragment() {
        // Required empty public constructor
    }

    public static SecondFragment newInstance(String param1, String param2) {
        SecondFragment fragment = new SecondFragment();
        Bundle args = new Bundle();
        args.putString(ARG_PARAM1, param1);
        args.putString(ARG_PARAM2, param2);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
            mParam1 = getArguments().getString(ARG_PARAM1);
            mParam2 = getArguments().getString(ARG_PARAM2);
        }
    }

    /**
     * 获取fragment布局文件ID
     *
     * @return
     */
    @Override
    protected int getLayoutId() {
        return R.layout.fragment_second;
    }

    /**
     * 初始化控键
     *
     * @param view
     * @param savedInstanceState
     */
    @Override
    protected void initView(View view, Bundle savedInstanceState) {



    }

    /**
     * 初始化标题栏
     */
    @Override
    protected void initTitle() {
        try {
            JSONObject json = new JSONObject();
            json.put("title", "设置titleBar");
            mListener.onFragmentInteraction(SETTITLE, json);
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    /**
     * 初始化presenters
     */
    @Override
    protected void initPresenters() {

    }


}
